﻿using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.ModelConfiguration.Conventions;
using RN.ERP.Entity.ZBDLRY;
using RN.ERP.Entity.Authority;
using Fly.Log;

namespace RN.ERP.DAL.Context
{
    public class OrderContext : DbContext
    {
        private const string CONNECTION_STRING_NAME = "name=OrderConnectionString";

        public OrderContext()
            : base(CONNECTION_STRING_NAME)
        {
            Database.SetInitializer<OrderContext>(null);
        }

        #region 实体操作集合

        public DbSet<tb_CAPayInfo> CAPayInfo { get; set; }
        public DbSet<tb_CAPayInfo_Sub> CAPayInfoSub { get; set; }
        public DbSet<tb_PayInfo> PayInfo { get; set; }
        public DbSet<tb_PayInfo_Sub> PayInfoSub { get; set; }
        public DbSet<tb_ProductInfo> ProductInfo { get; set; }
        public DbSet<tb_ProductGroupInfo> GroupInfo { get; set; }
        public DbSet<Tb_Invoice> Invoice { get; set; }
        public DbSet<Tb_InvoiceOrderRelation> InvoiceOrderRelation { get; set; }
        public DbSet<Tb_ProductUpdateInfo> ProductUpdateInfo { get; set; }
        public DbSet<CA_Cert> caCert { get; set; }

        #endregion

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }
}
